Skip to content

Remove rust, and add nix flake#951

Open
Pablu23 wants to merge 40 commits intomainfrom
feat-nix
Open

Remove rust, and add nix flake#951
Pablu23 wants to merge 40 commits intomainfrom
feat-nix

Conversation

@Pablu23
Copy link
Copy Markdown
Collaborator

@Pablu23 Pablu23 commented Mar 31, 2026

Description

  • Remove unused rust dependencies, remove setuptools_scm and use uv_build, add nix flake for container image, dev shell and application building

Assignee

  • The changes adhere to the contribution guidelines
  • I have performed a self-review of my code
  • My changes generate no new warnings (e.g. flake8/mypy/pytest/...) other than deprecations

Documentation

Code Quality

  • Patch test coverage > 95% and does not decrease
  • New code uses correct & specific type hints

How did you verify that the changes work in practice?

  • nix develop
  • nix build .#docker.python311 && docker load < result && docker run logprep:py3.11

Reviewer


The rendered docs for this PR can be found here.

@codecov-commenter
Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.20%. Comparing base (0fc524b) to head (e7228ba).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #951   +/-   ##
=======================================
  Coverage   96.20%   96.20%           
=======================================
  Files         218      218           
  Lines       14373    14373           
=======================================
  Hits        13828    13828           
  Misses        545      545           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Pablu23 Pablu23 marked this pull request as ready for review April 17, 2026 10:46
@Pablu23 Pablu23 requested a review from mhoff April 17, 2026 10:46
Copy link
Copy Markdown
Collaborator

@mhoff mhoff left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Many thanks for the work! I did a first review pass

Comment thread .envrc
@@ -0,0 +1 @@
use flake
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is only required for nix build, right? I am a bit hesitant to add this new file solely for builds and I would assume that it would also be loaded for all other operations (like running logprep etc.)

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is for direnv, if you have direnv installed and allow the directory, it auto loads the nix flake. I definitly need it, I previously did not commit it, but I have seen it on nearly every big open source project, so I thought it would be best practice to commit aswell. This by itself does nothing

with:
version: latest
- name: Set up Nix
uses: cachix/install-nix-action@v31
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Commit SHA. I assume you did not do this as the PR is not finalized yet, but I still wanted to add the comment as a reminder not to forget for future reviews

- name: Run Compose setup
working-directory: examples/compose
run: docker compose up -d
run: PYTHON_VERSION="${{ matrix.python-version }}" docker compose up -d
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was a bug right? ... nice catch

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah it probably was, I think before we actually always just used py3.11 for the checks it seems. I just changed this, because there now is no image called logprep:py3.11 when running in py3.12 matrix as we dont build it directly in the docker file

Comment thread .github/workflows/check-examples.yml Outdated
working-directory: examples/compose
run: docker compose build --build-arg PYTHON_VERSION=${{ matrix.python-version }}
run: |
export PY_VERSION="${{ matrix.python-version }}"
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not use the same wording as below (PYTHON_VERSION)? Does nix build use PY_VERSION internally? If not, let's simply use PYTHON_VERSION and put in under env together with COMPOSE_PROFILES. This way (as we are reusing compose-env in "Run Compose setup" we have it all in one go.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This has to do with the nameing of the docker file, .#docker.python311 is the current name for building 3.11, using .#docker.3.11 would then be something different as .#docker.311, thats why we export it as a variable and then do some Bash magic on it to transform 3.11 to python311, without the dot

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ahh no now I get what you mean, yeah ill change that. I was a little confused

Comment thread .github/workflows/container-build.yml
Comment thread .github/workflows/container-build.yml Outdated
Comment thread CHANGELOG.md Outdated
Comment thread Dockerfile Outdated
Comment thread doc/README.md
* install requirements with `uv sync --frozen --extra doc` in project root

## nix version
* nix develop
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't get what this means. Maybe still a placeholder. Needs more context because people are typically not familiar with nix

Edit: installation.rst makes it more clear, but still

Comment thread pyproject.toml Outdated
Pablu23 and others added 5 commits April 17, 2026 12:23
…ntainer version scheme, delete unused Dockerfile
Co-authored-by: Michael Hoff <9436725+mhoff@users.noreply.github.com>
Co-authored-by: Michael Hoff <9436725+mhoff@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants